/************************************************************
 * Copyright (C), 2022-2030, dina. Co., Ltd.
 * FileName:        share_function.h
 * Author:          Dan Yin
 * Date:            2022-11-23
 * Description:     the class of public function
 * Version:         1.0.0.0
 **********************************************************/
#ifndef SHARE_FUNCTION_H
#define SHARE_FUNCTION_H

#include <stdint.h>
#include <QElapsedTimer>

#define DF_ELAPSED_SLEEP(tm) \
    QElapsedTimer etTimer; \
    etTimer.start(); \
    while(etTimer.elapsed() < tm) { QCoreApplication::processEvents(); QThread::msleep(100); } \

// Obtain CRC16 verification results
unsigned short GetCRC16(const unsigned char *data, unsigned long len, unsigned long oldCRC16);


#endif // SHARE_FUNCTION_H
